import request from "../utils/request.ts";

export function findPages(pageNum:number, pageSize:number){
    return request({
        url: '/commodity/findPages',
        method: 'GET',
        data: {
            pageNum:pageNum,
            pageSize:pageSize
        }
    })
}

export function findCarList(){
    return request({
        url: '/commodity/findList',
        method: 'GET',
    })
}

export function findCarListByKey(key:string){
    return request({
        url: '/commodity/findListByKey',
        method: 'GET',
        params: {key:key}
    })
}

export function deleteOne(carid:string){
    return request({
        url: '/commodity/delete',
        method: 'POST',
        params: {carid:carid}
    })
}

export function fuzzySearch(data:any){
    return request({
        url: '/commodity/fuzzy',
        method: 'POST',
        data
    })
}

export function update(data:any){
    return request({
        url: '/commodity/update',
        method: 'POST',
        data
    })
}

export function insert(data:any){
    return request({
        url: '/commodity/insert',
        method: 'POST',
        data
    })
}
